Getting a part of a string in c